package com.minimalist.common.entity.basic.vo.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author 11987
 */
@Schema(name = "用户登录请求实体")
public class UserLoginReqVO implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "用户名不能为空")
    @Schema(name = "username", description = "用户名", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
    private String username;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @NotBlank(message = "密码不能为空")
    @Schema(name = "password", description = "密码", requiredMode = Schema.RequiredMode.REQUIRED, type = "string")
    private String password;

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Schema(name = "captchaId", description = "验证码ID，与验证码一一对应", type = "string")
    private String captchaId;

    public String getCaptchaId() {
        return captchaId;
    }

    public void setCaptchaId(String captchaId) {
        this.captchaId = captchaId;
    }

    @Schema(name = "captcha", description = "验证码", type = "string")
    private String captcha;

    public String getCaptcha() {
        return captcha;
    }

    public void setCaptcha(String captcha) {
        this.captcha = captcha;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserLoginReqVO that = (UserLoginReqVO) o;
        return Objects.equals(username, that.username) &&
               Objects.equals(password, that.password) &&
               Objects.equals(captchaId, that.captchaId) &&
               Objects.equals(captcha, that.captcha);
    }

    @Override
    public int hashCode() {
        return Objects.hash(username, password, captchaId, captcha);
    }

    @Override
    public String toString() {
        return "UserLoginReqVO{" +
               "username='" + username + '\'' +
               ", password='" + password + '\'' +
               ", captchaId='" + captchaId + '\'' +
               ", captcha='" + captcha + '\'' +
               '}';
    }
}
